package com.qianyu.project.web.controller.gs;

import com.qianyu.project.entity.SystemUser;
import com.qianyu.project.service.ISystemUserService;
import com.qianyu.project.utils.Result;
import com.qianyu.project.utils.ResultTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

/**
 * @author gs
 * @date create in 2021/2/2 17:33
 */
@RestController
@RequestMapping("/systemUsers")
public class SystemUserController {

    @Autowired
    private ISystemUserService systemUserService;

    @PostMapping
    public Result register(@RequestBody SystemUser systemUser) {
        systemUserService.register(systemUser);
        return ResultTool.success();
    }

    @PutMapping
    public Result updatePassword(@RequestBody SystemUser systemUser) {
        systemUserService.updatePassword(systemUser);
        return ResultTool.success();
    }
}
